package com.tbzz.mycloud;

import com.tbzz.mycloud.service.PaymentFeignService;
import com.tbzz.mycloud.vo.CommonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Slf4j
public class OrderFeignController {
    @Resource
    private PaymentFeignService paymentFeignService;
    @GetMapping(value = "/consumer/payment/get/{id}")
    public CommonResult getPaymentById(@PathVariable("id") Integer id){
        return paymentFeignService.getPaymentById(id);
    }

    /**
     * feign连接服务超时
     */
    @GetMapping(value ="/consumer/payment/timeOut")
    public String getTimeout(){
        return paymentFeignService.getTimeout();
    }
}
